<div ng-controller="promotionPosterAddCtrl">
    <div class="bg-light lter b-b wrapper-md">
        <h4 class="m-n font-thin">推广海报</h4>
        <button ui-sref="app.promotionPoster" class="btn-back btn btn-dark btn-sm btn-rounded">
            返回
        </button>
    </div>
    <div class="wrapper-md">
        <div class="row">
            <div class="col-md-4">
                <div class="file m-b" ng-disabled="uploadPictureStatus">
                    <span>推广海报上传</span>
                    <input type="file" nv-file-select nv-file-drop uploader="uploader" filter="picFilter" ng-click="checkedStatus(0)">
                </div>
                <div class="file m-b" ng-disabled="uploadIconStatus">
                    <span>二维码上传</span>
                    <input type="file" nv-file-select nv-file-drop uploader="uploader" filter="picFilter" ng-click="checkedStatus(1)">
                </div>
                <div class="file m-b" ng-disabled="true" ng-if="!uploadPictureStatus">
                    <span><i class="fa fa-refresh fa-spin m-r-xs"></i>正在上传</span>
                    <input type="text">
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h4 class="m-n font-thin">参数设置</h4>
                    </div>
                    <form name="promotionPosterForm" rol="form">
                        <div class="panel-body row">
                            <div class="m-b form-group form-inline">
                                <label class="col-sm-2 control-label text-right m-t-xs">海报尺寸</label>
                                <span>宽</span>
                                <input type="text" name="width" ng-model="promotionPosterVO.pmWidth" class="input-sm form-control" required>
                                <span>高</span>
                                <input type="text" name="height" ng-model="promotionPosterVO.pmHeight" class="input-sm form-control" required>
                                <div class="form-group col-sm-offset-2">
                                    <div ng-if="promotionPosterForm.width.$touched">
                                        <p ng-if="promotionPosterForm.width.$error.required" class="text-danger h6">宽是必须的</p>
                                    </div>
                                </div>
                                <div class="form-group col-sm-offset-4">
                                    <div ng-if="promotionPosterForm.height.$touched">
                                        <p ng-if="promotionPosterForm.height.$error.required" class="text-danger h6">高是必须的</p>
                                    </div>
                                </div>
                            </div>
                            <div class="m-b form-group form-inline">
                                <label class="col-sm-2 control-label text-right m-t-xs">二维码类型</label>
                                <select class=" input-sm form-control" ng-model="promotionPosterVO.type" ng-options="item.value as item.name for item in typeObject">
                                </select>
                            </div>
                            <div class="m-b form-group">
                                <label class="col-sm-2 control-label text-right m-t-xs">水印大小</label>
                                <botton class="btn btn-default" ng-click="reduceSize()">变小</botton>
                                <botton class="btn btn-default" ng-click="increaseSize()">变大</botton>
                            </div>
                            <div class="m-b form-group">
                                <label class="col-sm-2 control-label text-right m-t-xs">旋转角度</label>
                                <botton class="btn btn-default" ng-click="reduceDegree()">逆时针</botton>
                                <botton class="btn btn-default" ng-click="increaseDegree()">顺时针</botton>
                            </div>
                            <div class="m-b form-group">
                                <label class="col-sm-2 control-label text-right m-t-xs">透明度</label>
                                <botton class="btn btn-default" ng-click="reduceAlpha()">变小</botton>
                                <botton class="btn btn-default" ng-click="increaseAlpha()">变大</botton>
                            </div>
                            <div class="m-b form-group">
                                <label class="col-sm-2 control-label text-right m-t-xs">水印位置</label>
                                <botton class="btn btn-default" ng-click="reduceTLocation()">往上</botton>
                                <botton class="btn btn-default" ng-click="increaseTLocation()">往下</botton>
                                <botton class="btn btn-default" ng-click="reduceLLocation()">往左</botton>
                                <botton class="btn btn-default" ng-click="increaseLLocation()">往右</botton>
                            </div>
                        </div>
                    </form>
                </div>
                <div>
                    <button class="btn btn-info" ng-click="confirm()" ng-disabled="promotionPosterForm.$invalid||promotionPosterVO.srcImg==null||promotionPosterVO.icon==null">确定</button>
                    <button class="btn btn-info" ng-click="download()">下载</button>
                    <button class="btn btn-info" ng-if="confirmStatus" disabled><i class="fa fa-refresh fa-spin m-r-xs"></i>正在保存
                    </button>
                </div>
            </div>
            <div class="col-md-4 none-padding" ng-mousemove="moveIcon($event)" id="posterDiv">
                <img ng-src="{{app.image.temp}}{{promotionPosterVO.srcImg}}" class="srcImg b-a" style="width:{{promotionPosterVO.pmWidth}}px;height:{{promotionPosterVO.pmHeight}}px">
                <img ng-src="{{app.image.temp}}{{promotionPosterVO.icon}}" class="icon" id="icon"
                     ng-mousedown="moveStatus=!moveStatus"
                     style="left:{{promotionPosterVO.lLocation}}px;top:{{promotionPosterVO.tLocation}}px;-moz-opacity:{{promotionPosterVO.alpha}};opacity:{{promotionPosterVO.alpha}};transform:rotate({{promotionPosterVO.degree}}deg);width:{{promotionPosterVO.widthSize}}px;height:{{promotionPosterVO.heightSize}}px">
            </div>
        </div>
    </div>
</div>